package com.hnust.service.test;

import com.hnust.MainApp;
import com.hnust.domain.record.*;

import com.hnust.service.SubjectService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = MainApp.class)
public class testSubjectService {
    @Autowired
    private SubjectService subjectService;

    @Test
    public void testGetQuestionList(){
        try{
            List<SubjectDataRecord> s = subjectService.getQuestionList("ac8c18382d","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEiLCJpZCI6IjEwIiwiZXhwIjoxNjA4MTE5NTg5LCJpYXQiOjE2MDc1MTQ3ODksImp0aSI6IjZhMWIyYzE1NmIxMzQxNjNhZDBmYzg4Y2Y3NDE4M2QwIn0.83Vz2vaNCT0pQbMo7nyLwasd9SJBxJcB9UmrLxkDchQ","1",0,1);

        }catch (Exception e){
            return ;
        }
    }
    @Test
    public void testGetCourse(){
        List<CourseData> s = subjectService.getCourseData("as8x145fds","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEwMDg2IiwiaWQiOiIxMDA4NiIsImV4cCI6MTYwNDU4NDA0MywiaWF0IjoxNjAzOTc5MjQzLCJqdGkiOiI4OTUyY2ZmMWY0MjQ0ZjJhYjY1NWU1Y2NmMWQ3N2E1OCJ9.vnVGOFY8rQS7ziWfKuUfyZcbtvejR1Dpn42Ka_Qs2mU");
    }
    @Test
    public void testSeachQuestion(){
        try{
           List<SubjectDataRecord> s = subjectService.getCourseSubByCon("ac8c18382d","1","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEiLCJpZCI6IjEwIiwiZXhwIjoxNjA4MTE5NTg5LCJpYXQiOjE2MDc1MTQ3ODksImp0aSI6IjZhMWIyYzE1NmIxMzQxNjNhZDBmYzg4Y2Y3NDE4M2QwIn0.83Vz2vaNCT0pQbMo7nyLwasd9SJBxJcB9UmrLxkDchQ","1",0,1);

        }catch (Exception e){
            return ;
        }
    }

    @Test
    public void testGetQueType(){
        List<QuestionTypeRecord> a = subjectService.questionType("as8x145fds","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEwMDg2IiwiaWQiOiIxMDA4NiIsImV4cCI6MTYwNDU4NDA0MywiaWF0IjoxNjAzOTc5MjQzLCJqdGkiOiI4OTUyY2ZmMWY0MjQ0ZjJhYjY1NWU1Y2NmMWQ3N2E1OCJ9.vnVGOFY8rQS7ziWfKuUfyZcbtvejR1Dpn42Ka_Qs2mU","ersdaf");

    }
    @Test
    public void testGetCourseTarget(){
        List<CourseTargetRecord> a = subjectService.getCourseTargetList("ersdaf","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEwMDg2IiwiaWQiOiIxMDA4NiIsImV4cCI6MTYwNDU4NDA0MywiaWF0IjoxNjAzOTc5MjQzLCJqdGkiOiI4OTUyY2ZmMWY0MjQ0ZjJhYjY1NWU1Y2NmMWQ3N2E1OCJ9.vnVGOFY8rQS7ziWfKuUfyZcbtvejR1Dpn42Ka_Qs2mU","as8x145fds");

    }
//    @Test
//    public  void testModifyQuestion(){
//        List<AnswerObjRecord> answerObjList = new ArrayList<>();
//        AnswerObjRecord answerObj1 = new  AnswerObjRecord("纯度大大降低了!",true);
//        AnswerObjRecord answerObj2 = new  AnswerObjRecord("纯度大大提高了!",false);
//        AnswerObjRecord answerObj3 = new  AnswerObjRecord("纯度有什么用吗?!",false);
//        answerObjList.add(answerObj1);
//        answerObjList.add(answerObj2);
//        answerObjList.add(answerObj3);
//        SubjectDataRecord subjectData= new SubjectDataRecord("5","纯度的用处？","ersdaf","1000003","4444",1,"纯度？有什么用吗","不会","1659423351",1,answerObjList);
//        String a =subjectService.updateSubInfo(subjectData,"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEwMDg2IiwiaWQiOiIxMDA4NiIsImV4cCI6MTYwNDU4NDA0MywiaWF0IjoxNjAzOTc5MjQzLCJqdGkiOiI4OTUyY2ZmMWY0MjQ0ZjJhYjY1NWU1Y2NmMWQ3N2E1OCJ9.vnVGOFY8rQS7ziWfKuUfyZcbtvejR1Dpn42Ka_Qs2mU","as8x145fds");

//    }
//    @Test
//    public void testAddQuestion(){
//        List< AnswerObjRecord> answerObjList = new ArrayList<>();
//        AnswerObjRecord answerObj1 = new  AnswerObjRecord("纯度大大降低了",false);
//        AnswerObjRecord answerObj2 = new  AnswerObjRecord("纯度大大提高了",false);
//        AnswerObjRecord answerObj3 = new  AnswerObjRecord("123",false);
//        answerObjList.add(answerObj3);
//        SubjectDataRecord subjectData1= new SubjectDataRecord("1453","纯度的用处？","ersdaf","1000003","4444",1,"纯度？有什么用吗","不会","1659423351",1,answerObjList);
//        SubjectDataRecord subjectData2=new SubjectDataRecord("529","纯度的有用吗？","ersdaf","1000003","4444",1,"纯度？有什么用吗","不会吧。不会吧","1659423351",1,answerObjList);
//        List<SubjectDataRecord> subjectDataList = new ArrayList<>();
//        subjectDataList.add(subjectData1);
//        subjectDataList.add(subjectData2);
//        String a =subjectService.addSub(subjectDataList,"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEwMDg2IiwiaWQiOiIxMDA4NiIsImV4cCI6MTYwNDU4NDA0MywiaWF0IjoxNjAzOTc5MjQzLCJqdGkiOiI4OTUyY2ZmMWY0MjQ0ZjJhYjY1NWU1Y2NmMWQ3N2E1OCJ9.vnVGOFY8rQS7ziWfKuUfyZcbtvejR1Dpn42Ka_Qs2mU","as8x145fds");

//    }
    @Test
    public void testGetChapter(){
        List<CourseChapter> a = subjectService.getCourseChapterList("ac8c18382d","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEwMDg2IiwiaWQiOiIxMDA4NiIsImV4cCI6MTYwNDU4NDA0MywiaWF0IjoxNjAzOTc5MjQzLCJqdGkiOiI4OTUyY2ZmMWY0MjQ0ZjJhYjY1NWU1Y2NmMWQ3N2E1OCJ9.vnVGOFY8rQS7ziWfKuUfyZcbtvejR1Dpn42Ka_Qs2mU","as8x145fds");

    }
}
